Constant-time substring implementations in Java code can cause memory problems because the substring reference prevents the original string from being garbage collected. Java代码中耗时恒定的子串实现会引起内存问题,因为子串引用会阻止初始字符串被进行垃圾搜集。
To mark a matched substring for future reference. 记录一个已匹配的子串用作后面的参考引用。